home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / xgui / sources / d3_dither.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-25  |  1.0 KB  |  42 lines

  1. /*****************************************************************************
  2.   FILE           : d3_dither.c
  3.   SHORTNAME      : dither.c
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : dithering of graylevels on a monochrome display
  7.   NOTES          :
  8.  
  9.   AUTHOR         : Ralf Huebner
  10.   DATE           : 1.12.1991
  11.  
  12.   CHANGED BY     : Sven Doering
  13.   IDENTIFICATION : @(#)d3_dither.c    1.8 3/2/94
  14.   SCCS VERSION   : 1.8
  15.   LAST CHANGE    : 3/2/94
  16.  
  17.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  18.  
  19. ******************************************************************************/
  20.  
  21. #include "d3_dither.ph"
  22.  
  23. /*****************************************************************************
  24.   FUNCTION : dither
  25.  
  26.   PURPOSE  : calculate the dither value
  27.   RETURNS  : 0 if black or 1 if white
  28.   NOTES    :
  29.  
  30. ******************************************************************************/
  31.  
  32.  
  33. int dither (int x, int y, float level)
  34. {
  35.     return (level * size*size > dither_matrix[(x % size) + size * (y % size)]);
  36. }
  37.  
  38.  
  39. /* end of file */
  40. /* lines: 71 */
  41.  
  42.